package pers.lmd.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.lmd.domain.dto.HealthDTO;
import pers.lmd.service.IHealthService;

/**
 * @Author lmd
 * @Date 2023/4/30 17:33
 */

@RequiredArgsConstructor
@RestController
@RequestMapping("/system")
@Tag(name = "每日打卡控制器")
public class HealthController {

    private final IHealthService IHealthService;

    @Operation(summary = "每日打卡")
    @PostMapping("/health")
    public void add(@RequestBody HealthDTO healthDTO) {
        IHealthService.saveHealth(healthDTO.getStatus(), healthDTO.getIsCough(), healthDTO.getTemperature(), healthDTO.getAddress());
    }
}
